package ThreadTest;

class threaddemo extends Thread{
    private String name;

    public threaddemo(String name){
        this.name=name;
    }

    @Override
    public void run() {
        for (int i=0;i<10;i++){
            System.out.println(this.name+"运行:"+"i="+i);
        }

    }

}
public class ThreadDemo01 {
    public static void main(String[] args) {
        threaddemo m1=new threaddemo("线程A");
        threaddemo m2 = new threaddemo("线程B");
        threaddemo m3 = new threaddemo("线程C");
        new Thread(m1).start();
        new Thread(m2).start();
        new Thread(m3).start();
//        m1.start();
//        m2.start();
//        m3.start();
    }

}
